#include "widget.h"
#include "ui_widget.h"
#include <QDateTimeEdit>

#include "qcustomcalendarwidget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QCustomCalendarWidget* startCalendarWidget = ui->calendarWidget;
    QCustomCalendarWidget* endCalendarWidget = ui->calendarWidget_2;
    endCalendarWidget->startFilg_ = 0;


    startCalendarWidget->setContextMenuPolicy(Qt::NoContextMenu);
    endCalendarWidget->setContextMenuPolicy(Qt::NoContextMenu);


    connect(startCalendarWidget,&QCustomCalendarWidget::clicked,this,[this](const QDate& date){
        ui->calendarWidget->setRangeDate(date);
    });

    connect(endCalendarWidget,&QCustomCalendarWidget::clicked,this,[this](const QDate& date){
        ui->calendarWidget_2->setRangeDate(date);
    });
}

Widget::~Widget()
{
    delete ui;
}

